package com.innjia.base.utils;

import java.util.HashMap;
import java.util.Map;

public class UrlParamMapUtil {

	/**
	 * url get请求参数转换成map
	 * @param urlParam
	 * @return
	 * Map<String,String>
	 */
	public static Map<String, String> urlParamToMap(String urlParam) {
		Map<String, String> map = new HashMap<String, String>(); 
		if(StringUtils.isEmpty(urlParam)) {
			return map;
		}
		String[] params = urlParam.split("&");
		if(params != null) {
			for(String param : params) {
				String[] p = param.split("=");
				if(p != null && p.length == 2) {
					map.put(p[0], p[1]);
				}
			}
		}
		return map;
	}
}
